package com.itwenke.springbootdemo.shirowebboot.service.impl;

import com.itwenke.springbootdemo.shirowebboot.entity.Permission;
import com.itwenke.springbootdemo.shirowebboot.mapper.PermissionMapper;
import com.itwenke.springbootdemo.shirowebboot.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;

@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public Set<Permission> findPermsByRoleSet(Set<Long> roleIdSet) {
        if (roleIdSet.isEmpty()) {
            return new HashSet<>();
        }
        return permissionMapper.findPermsByRoleIdIn(roleIdSet);
    }
}
